// import Vue from 'vue'
// import VueRouter from 'vue-router'

// Vue.use(VueRouter)

// const routes = [
//   {
//     path: '/',
//     name: 'login',
//     component: () => import('../views/Login.vue') // 将登录表单移出App.vue
//   },
//   {
//     path: '/list',
//     name: 'list',
//     component: () => import('../views/list.vue')
//   }
// ]

// const router = new VueRouter({
//   mode: 'history',
//   base: process.env.BASE_URL,
//   routes
// })

// export default router

// index.js
import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'login',
    component: () => import('../views/Login.vue') // 将登录表单移出App.vue
  },
  {
    path: '/list',
    name: 'list',
    component: () => import('../views/list.vue'),
    children: [
      {
        path: 'admin-home',
        name: 'AdminHome',
        component: () => import('../views/AdminHome.vue')
      },
      {
        path: 'admin-home2',
        name: 'AdminHome2',
        component: () => import('../views/AdminHome2.vue')
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router